/*
 *  $Id: Manaflow.cs 1051 2010-05-18 22:10:41Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Water.Spells {
    public class Manaflow: SpellCard {
        public Manaflow(): base("001_w_s_manaflow") {
            Level = CompleteLevel.Final;
            Element = ElementType.Water;
            Value = 100;
            AddManaCost(ElementType.Water, 2);
        }

        public override void DoAction(TargetArgs args) {
            int sum = 0, mana;
            foreach (ElementType element in ElementType.ManaElements) {
                if (element != ElementType.Water) {
                    mana = args.Player.GetMana(element);
                    if (mana > 0) {
                        sum += mana;
                        args.Player.DecrementMana(element, mana);
                    }
                }
            }
            args.Player.IncrementMana(ElementType.Water, sum);
        }
    }
}
